<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>消息详情</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
		<style>
			h5 {
				margin: 5px 7px;
			}
			
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">消息详情</h1>
		</header>
		<div class="mui-content">
			<form class="mui-input-group">
					<div class="mui-input-row">
						<label>工程名称:</label>
						<input type="text" id="proname"class="mui-input-clear" placeholder="请输入工程名称">
					</div>						

				<!--这里放图片-->
			</div>

			</form>
		</div>
	</body>
	
	<script src="../js/mui.min.js"></script>
	<script src="../js/wf.js"></script>
	<script src="../js/zepto.min.js"></script>
	<script src="../js/mui.zoom.js"></script>
	<script src="../js/mui.previewimage.js"></script>
	 <script src="../js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
	
	(function(doc) {
		mui.init();
		mui.previewImage();
		mui.plusReady(function() {	
		var self = plus.webview.currentWebview();
		//var username = self.username;	
		var proid=self.proid;
		
		plus.nativeUI.showWaiting();
				wf.ajax("Notice/GetNoticeByID",{
				traditional :true, 
				type: "Get",	
				data:{"ID":proid},
				dataType:"json",
					success:function(resule){					
					if (resule.Code == "20000") {
						//mui.toast(resule.Data);
						showImg(proid);
						plus.nativeUI.closeWaiting();	
						var data=JSON.parse(resule.Data);
							document.getElementById("proname").value=data.ProName;
							document.getElementById("otherinfo").value=data.OtherInfo;
						}
					}
				});
		
		
		
		//提交修改事件
			$("#btnSave").on("tap",function(){				
				if ($("#proname").val() == "") {
					event.detail.gesture.preventDefault(); //阻止默认事件
					mui.toast("工程名称不能为空!");
					mui.focus($("#proname"));
					return;
				}
				var datas = new Object();
				datas.ProName = $("#proname").val();
				datas.OtherInfo = $("#otherinfo").val();
				//datas.CreatePeople=username;
				datas.isModify=1;
				datas.hidNoticeID=proid;
				plus.nativeUI.showWaiting();
				wf.ajax("Notice/NoticeAdd",{
				traditional :true, 
				type: "post",	
				data:datas,
				dataType:"json",
					success:function(resule){					
					if (resule.Code == "20000") {
						mui.toast(resule.Msg);
						plus.nativeUI.closeWaiting();			
							refreshParent();	//刷新父窗体															
						}
					}
				});
			});						
		});
	}(document));
	
	function refreshParent(){
		var main = plus.webview.getWebviewById('noticelist');//或者通过A页面id获取A页面对象
		main.reload(true);
			mui.fire(main, "pageflowrefresh" );
			mui.back();
	}
	function showImg(proid) {
		var _img_ = new Image();
		_img_.style.border = "1px solid rgb(200,199,204)";
		_img_.style.margin = "5px";
		_img_.style.width = "50%";
//		_img_.style.height = "200px";
		_img_.id=proid;
		var picname="Pro_"+proid;
		_img_.src = wf.server_Domain+"FileUpload/ReadPic?name="+picname;
		var div = document.getElementsByClassName("imgcontent")[0];
		div.appendChild(_img_);
		$("#"+proid).attr("data-preview-src","");
		$("#"+proid).attr("data-preview-group",1);
	}
	
	</script>
	
</html>

